-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(streams): prevent earlyZipReadableStreams()
from possibly using excessive memory
#5082
fix(streams): prevent earlyZipReadableStreams()
from possibly using excessive memory
#5082
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5082 +/- ##
==========================================
- Coverage 92.51% 92.51% -0.01%
==========================================
Files 481 481
Lines 38722 38719 -3
Branches 5444 5441 -3
==========================================
- Hits 35822 35819 -3
Misses 2845 2845
Partials 55 55 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Thank you for the solid troubleshooting.
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
earlyZipReadableStreams
earlyZipReadableStreams()
from possibly using excessive memory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a final tweak to the cancel reason. Thank you very much, @BlackAsLight. Great work.
Jumping from: #5078 (comment)
This pull request changes the structure of the readable stream to use a pull method instead of the start method, stopping it from the possibility of using excessive memory, possibly overflowing it if not consumed fast enough, or at all. This alternative also offers a way to cancel the provided reason streams from the returned stream.
Current Version - overloaded the memory
Alterative Version
Benchmark
This refactor did turn out to be slightly slower than the existing one in a benchmark.